package com.ruoyi.system.api;

import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.factory.RemoteUserFallbackFactory;
import com.ruoyi.system.api.model.LoginWxUser;
import com.yxzz.core.domain.TUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 用户服务
 * 
 * @author ruoyi
 */
@FeignClient(contextId = "remoteWxUserService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteUserFallbackFactory.class)
public interface RemoteWxUserService
{
    /**
     * 通过用户名查询用户信息
     *
     * @param openId wx openId
     * @param source 请求来源
     * @return 结果
     */
    @GetMapping("/wxuser/openId/{openId}")
    public R<LoginWxUser> getInfoByOpenId(@PathVariable("openId") String openId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);


    /**
     * 注册用户信息
     *
     * @param tUser 用户信息
     * @param source 请求来源
     * @return 结果
     */
    @PostMapping("/wxuser/register")
    public R<Boolean> registerUserInfo(@RequestBody TUser tUser, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
